﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Hotel.aspx.cs" Inherits="HQWeb.SysManage.HotelManage.Hotel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Styles/Site.css" rel="Stylesheet" type="text/css" />
    <script type="text/javascript">
        function bindstyle(str) {
            if (str != null && str != "") {
                var newschool = str.split(',');
                for (var i in newschool) {
                    var checkstyle = "j" + newschool[i];
                    var style = document.getElementById(checkstyle);
                    if (style != null && style != undefined) {
                        style.checked = true;
                    }
                }
            }
        }

        function AddData() {
            var els = document.getElementsByName("jstyle");
            var weddingStyle = document.getElementById("hidHotelStyle").value;
            for (var i = 0; i < els.length; i++) {
                if (els[i].tagName.toLowerCase() == "input" && els[i].type == "checkbox" && els[i].checked == true) {
                    var attribute = els[i].getAttribute("value");
                    if (weddingStyle != null && weddingStyle != "") {
                        weddingStyle = weddingStyle + attribute + ",";
                    }
                    else {
                        weddingStyle = "," + attribute + ",";
                    }
                }
            }
            document.getElementById("hidHotelStyle").value = weddingStyle;
            document.getElementById("btn_Add").click();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="98%">
            <tr>
                <td colspan="4" class="title">
                    <asp:Label runat="server" ID="labTitle" Text="酒 店"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%">
                    酒店名称 ：
                </td>
                <td colspan="3">
                    <asp:TextBox runat="server" ID="txtName"></asp:TextBox><span style="color: Red">*</span><asp:RequiredFieldValidator
                        runat="server" ID="rev_Num" ControlToValidate="txtName" ForeColor="Red" ErrorMessage="请您输酒店名称！"
                        Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    酒店风格：
                </td>
                <td id="addhotelstyle" colspan="3" runat="server">
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    酒店桌数：
                </td>
                <td align="left">
                    <asp:DropDownList ID="drop_desknum" Width="88px" runat="server">
                    </asp:DropDownList>
                </td>
                <td align="right" style="width: 20%;">
                    大厅规格：
                </td>
                <td align="left">
                    <asp:DropDownList ID="hotel_specification" Width="88px" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%;">
                    地理位置：
                </td>
                <td align="left" colspan="3">
                    <input id="hotel_location" style="width: 50%;" runat="server" type="text" />
                </td>
            </tr>
            <tr>
                <td align="right">备注：</td>
                <td colspan="3"><asp:TextBox ID="Remark" runat="server" Width="50%" TextMode="MultiLine"></asp:TextBox></td>
            </tr>
            <tr>
                <td colspan="4" align="center">
                    <%--<asp:Button ID="btn_Add" runat="server" Text="保 存" Width="61px" CommandName="add"
                    OnClick="btn_Add_Click" />--%>
                    <input type="button" id="Add" value="保 存" onclick="AddData()" />
                    <input type="button" id="btn_back" value="返 回" onclick="javascript:location='HotelList.aspx'" />
                </td>
        </table>
    </div>
    <div style="display: none">
        <asp:HiddenField ID="hidID" runat="server" />
        <asp:HiddenField ID="hidHotelStyle" runat="server" />
        <asp:Button ID="btn_Add" runat="server" CommandName="add" OnClick="btn_Add_Click" />
    </div>
    </form>
</body>
</html>
